from config import url
import requests


class EmpApi:
    def __init__(self, url_path='/api/sys/user'):
        self.emp_url = url + url_path

    def add_emp(self, body, headers):
        return requests.post(self.emp_url, json=body, headers=headers)

    def delete_emp(self, query, headers):
        return requests.delete(self.emp_url+'/'+query, headers=headers)

    def query_emp(self, query, headers):
        return requests.get(self.emp_url+'/'+query, headers=headers)

    def modify_emp(self, query, body, headers):
        return requests.put(self.emp_url+'/'+query, json=body, headers=headers)
